package yuanyuan;

/**
 * @Author YuanYuan
 * @Date 2022/5/14
 * @Time 10:02
 */
 class Human{
    public String name;
    protected String sex;
    private int age;
    public static double height;
    public double weight = 45.5;

    public Human(String name) {
        System.out.println(name+ "父类构造方法");
    }
    public void talk() {
        System.out.println(name+"会说话");
    }
}
class A extends Human{
    public double weight = 55.5;
    public A(){
        super("pig");
        System.out.println("子类构造方法");
    }
    public void func() {
        System.out.println(weight);
        System.out.println(super.weight);
//        System.out.println(height);
//        System.out.println(sex);
//        System.out.println(age);
//        System.out.println(getAge());
    }
    public void writeCode(){
        System.out.println(name+"会写代码");
    }

}
public class Test {
    protected int num1;
    public static void main(String[] args) {
        A a = new A();
        //a.name = "菜狗";
//        a.talk();
//        a.writeCode();
        //a.func();
    }
}
